package util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class MysqlUtil {


    private static final String JBDC = "com.mysql.cj.jdbc.Driver";
    private static final String DB_URl = "jdbc:mysql://127.0.0.1:3306/test_project?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC";

    private static final String DB_USER = "root";

    private static final String DB_PASSWORD = "root";

    public static Statement JBDC() {
        try {
            Class.forName(JBDC);
            Connection connection = DriverManager.getConnection(DB_URl, DB_USER, DB_PASSWORD);
            Statement statement = connection.createStatement();
            return statement;
        } catch (Exception e) {
            throw new RuntimeException(e);
        } }
        public static void main (String[] args){
            JBDC();
        }
    }